﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="InCacNghiepVuKho.ascx.cs" Inherits="WebUserControl_InBaoCao" %>
<%@ Register assembly="msgBox" namespace="BunnyBear" tagprefix="cc1" %>
<%@ Import Namespace="BCDataCenter.BOL" %>
<%@ Register src="uscTitleForm.ascx" tagname="uscTitleForm" tagprefix="uc1" %>
<link rel="stylesheet" href='<%=ResolveUrl("~/LayoutCss/K_BaoCaoFormLayout.css")%>' type="text/css" />


<script language="javascript">
    function PrintedReport(radioObj) {
        if (getCheckedValue(radioObj) != "")
        {
            window.open('Print.aspx', 'PrintMe', 'height=900px,width=900px,scrollbars=1');             
        }
        else
        {
            alert('Bạn chưa chọn chứng từ cần in.');
            
        }
    }
    function getCheckedValue(radioObj) {
        if (!radioObj)
            return "";
        var radioLength = radioObj.length;
        if (radioLength == undefined)
            if (radioObj.checked)
            return radioObj.value;
        else
            return "";
        for (var i = 0; i < radioLength; i++) {
            if (radioObj[i].checked) {
                return radioObj[i].value;
            }
        }
        return "";
    }
    
    function setCheckedValue(radioObj, newValue) {
        if (!radioObj)
            return;
        var radioLength = radioObj.length;
        if (radioLength == undefined) {
            radioObj.checked = (radioObj.value == newValue.toString());
            return;
        }
        for (var i = 0; i < radioLength; i++) {
            radioObj[i].checked = false;
            if (radioObj[i].value == newValue.toString()) {
                radioObj[i].checked = true;
            }
        }
    }

    
</script>

<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" RenderMode="Block">
    <ContentTemplate>
    <fieldset>
    <legend>In các nghiệp vụ kho</legend>
    
                   
                   
                       
          <div class="fm-req">
                       <label for="txtMaTuVanVien">Nghiệp vụ:</label>
                        <asp:DropDownList ID="DropListNghiepVu" runat="server" Width="250px"  AutoPostBack="True"     onselectedindexchanged="DropListNghiepVu_SelectedIndexChanged">
                        </asp:DropDownList>
           </div>
          
      </fieldset>
    <br />
    <asp:GridView ID="gvListNghiepVuCanIn" runat="server" 
                            AutoGenerateColumns="False" Width="100%" 
                            onrowcommand="gvListNghiepVuCanIn_RowCommand" AllowPaging="True" 
                            onpageindexchanging="gvListNghiepVuCanIn_PageIndexChanging" PageSize="20">
                            <Columns>
                                <asp:TemplateField HeaderText="In ?">
                                    <ItemTemplate>
                                      
                                        <asp:ImageButton ID="btnPrint" runat="server"  CommandName="Printed"
                                         ImageUrl="~/WebMaster/Images/Printer.png" ToolTip="In nghiệp vụ" Width="32px" />
                                    </ItemTemplate>
                                    <ItemStyle Width="40px" HorizontalAlign="Center" />
                                </asp:TemplateField>
                                <asp:BoundField DataField="docno" HeaderText="Số chứng từ" />
                                <asp:BoundField DataField="docdate" HeaderText="Ngày chứng từ" />                                
                                <asp:CheckBoxField DataField="Printed" HeaderText="Đã in" >
                                    <ItemStyle HorizontalAlign="Center" Width="50px" />
                                </asp:CheckBoxField>
                            </Columns>
                        </asp:GridView>
                  
    
</ContentTemplate>
</asp:UpdatePanel>